import Vue from 'vue'
import Vuex from 'vuex'

import persistedstate  from 'vuex-persistedstate'

Vue.use(Vuex);//vue的插件机制

import user from './modules/user.js'

//Vuex.Store 构造器选项
const store = new Vuex.Store({
	modules:{
		user,
	},
	plugins:[
		persistedstate({
			storage:{
				getItem: (key) => uni.getStorageSync(key), // 获取  
				setItem: (key, value) => uni.setStorageSync(key, value), // 存储  
				removeItem: (key) => uni.removeStorageSync(key) // 删除  
			}
		})
	]
})
export default store